<template>
  <PageTemplate>
    <div slot="content">
    <!-- <div class="brand">
      <breadcrumb :arrayName="brand" :hasIcon="hasIcon"></breadcrumb>
    </div> -->

    <div class="container">
      <div>
          <el-row style="margin-top:15px;padding-top:15px;">
              <el-tabs  type="card" v-model="showTabs" @tab-click="toggleTab" >
                  <!-- 是否改写组件形式 减少单页面代码量？-->
                  <el-tab-pane :label="$t('wd.delegate_work')" name="delegate_work">

                  </el-tab-pane>
  
                  <el-tab-pane :label="$t('wd.trustee_work')" name="entrusted_work">

                  </el-tab-pane>
  
                </el-tabs>
          </el-row>
        <el-row class="table-body">
          <el-table :data="delegateList"  class="no_line" fixed>
            <el-table-column type="index"  :label="$t('wd.order')" ></el-table-column>
            <el-table-column prop="fromUserName" :label="$t('wd.delegate_man')"></el-table-column>
            <el-table-column prop="toUserName" :label="$t('wd.trust_man')"></el-table-column>
            <el-table-column prop="appCode" :label="$t('wd.flow_type')"></el-table-column>
            <el-table-column prop="startTime" :formatter="transDate" :label="$t('wd.begin_time')"></el-table-column>
            <el-table-column prop="endTime" :formatter="transDate" :label="$t('wd.end_time')"></el-table-column>
            <el-table-column prop="isEnabled" :formatter="transStatus"  :label="$t('wd.flow_status')"></el-table-column>
            <el-table-column :label="$t('cm.operate')">
              <template slot-scope="scope" >
                <!-- <el-button type="text" size="small" @click="editDelegate(scope.row)"  >{{$t('cm.edit')}}</el-button>
                <el-button type="text" size="small"  >{{$t('wd.disable')}}</el-button> -->
                <el-button type="text" size="small" class="el-button-del" @click="delDelegate(scope.row)"  >{{$t('cm.delete')}}</el-button>
              </template>
            </el-table-column>

          </el-table>
        </el-row>

        <el-row class="table-bottom" >
          <!--按钮-->
          <div class="table-bottom-btn-group" >

            <!--新增委托-->
            <el-button class="btn-add btn1" @click="addDelegate"   size="small"><i class="el-icon-circle-plus "></i> {{$t('wd.add_delegate')}}</el-button>

          </div>
          <!-- 翻页 -->
          <el-pagination
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"
            @prev-click="prePage"
            @next-click="nextPage"
            :current-page="currentPage"
            :page-sizes="[10, 20, 30, 40]"
            :page-size="pageSize"
            layout="total, sizes, prev, pager, next, jumper"
            :total="total">
          </el-pagination>
        </el-row>

      </div>

    </div>
  </div>
  </PageTemplate>
</template>

<script>
  import work_deletgate from './js/work_delegate.js'
  export default work_deletgate
</script>

<style scoped>

</style>
